<?php 
if(isset( $this->dbProfiler ) && $this->dbProfiler->getEnabled() && $this->dbProfiler->getTotalNumQueries() > 0) :?>
	<div dir="ltr" >
		<div style="text-align:center" >
		<h2>Database Profiling Report</h2>
		    <p>Total queries executed: <?php echo $this->dbProfiler->getTotalNumQueries()?></p>
		    <p>Total elapsed time: <?php echo $this->dbProfiler->getTotalElapsedSecs()?></p>
		</div>
		<table class="spreadsheet" cellpadding="0" cellspacing="0" style="margin:10px auto">
			<thead>
				<tr>
					<th>#</th>
					<th>Query</th>
					<th>Time</th>
				</tr>
			</thead>
			<tbody>
				<?php foreach ($this->dbProfiler->getQueryProfiles() as $queryNumber => $query) : ?>
					<tr>
						<td>(<?php echo $queryNumber + 1?>)</td>
						<td><?php echo $query->getQuery();?></td>
						<td><?php echo $query->getElapsedSecs();?></td>
					</tr>
				<?php endforeach;?>
			</tbody>
		</table>
	</div>
<?php endif;?>
